<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>all模拟接口数据请求</title>
</head>

<body>
    <script>
        // 获取用户列表信息
        function getUserList() {
            return new Promise((resolve, reject) => {
                // 定时器模拟
                setTimeout(() => {
                    resolve('请求用户列表的数据...')
                }, 1000)
            })
        }
        // 获取轮播图信息
        function getBannersList() {
            return new Promise((resolve, reject) => {
                setTimeout(() => {
                    resolve('请求轮播图信息...')
                }, 2000)
            })
        }
        // 获取视频列表数据
        function getVodieList() {
            return new Promise((resolve, reject) => {
                setTimeout(() => {
                    resolve('请求视频信息...')
                }, 3000)
            })
        }
        // 模拟程序启动
        function init() {
            let all = Promise.all([getUserList(), getBannersList(), getVodieList()])
            all.then(value => {
                console.log(value)
            })
        }
        init()
    </script>
</body>

</html>